package com.cennavi.buss.service.imp;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.cennavi.buss.service.UserService;
import com.cennavi.minemap.bean.MessageBean;

@FeignClient(value = "user-service", fallback = UserService.class)
public interface IUserService {
	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/login")
	public MessageBean login(@RequestBody String json);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/register")
	public MessageBean register(@RequestBody String json);

	@RequestMapping(method = RequestMethod.GET, value = "/service/user/update")
	public MessageBean update(@RequestBody String json);

	@RequestMapping(method = RequestMethod.GET, value = "/service/user/{id}")
	public MessageBean detail(@PathVariable(value = "id") int id);

	@RequestMapping(method = RequestMethod.GET, value = "/service/user/expiry")
	public MessageBean getExpire();

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/unique")
	public MessageBean uniqueVerify(@RequestBody String json);

	@RequestMapping(method = RequestMethod.GET, value = "/service/user/sendVer")
	public MessageBean sendVer(@RequestParam("mail") String mail);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/verification")
	public MessageBean verification(@RequestBody String json);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/updatePwd")
	public MessageBean updatePassword(@RequestBody String json);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/mailboxVeri")
	public MessageBean mailboxVeri(@RequestBody String json);

	@RequestMapping(method = RequestMethod.GET, value = "/service/user/role/{userId}")
	public MessageBean queryRoleByUserId(@PathVariable(value = "userId") int userId);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/tencent/register")
	public MessageBean tencentRegister(@RequestBody String text);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/tencent/login")
	public MessageBean tencentLogin(@RequestBody String text);

	@RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/user/tencent/verification")
	public String tencentVerification(@RequestBody String text);
}
